<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function have_permission($groupid){
    global $user;
    $userid= isset($_SESSION['id'])?$_SESSION['id']:0;
    if ($userid ==0){
        throw new Exception("You're not logged in!");
    }
    $info = $user->get_user_info($userid);
    return $info['usergroups_id']==$groupid;

    }


?>
